﻿<local:DocumentBase x:Class="WPFExcelReport.YCAFS05CHGD"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:mx="clr-namespace:DynamicListView.Controls;assembly=MatrixLib"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                    Height="700" Width="1024" 
                    FontSize="16"
                   Background="White"
                    Loaded="Window_Loaded"
     >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/> 
        <db:SETINTEXDB  x:Key="SetProd" />
        <CollectionViewSource   x:Key="vwFSSTUELI" Source="{Binding Path=FSSTUELI,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwWDECK" Source="{Binding Path=WDECK,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwFDECK" Source="{Binding Path=FDECK,Source={StaticResource SetProd}}" />
    </local:DocumentBase.Resources>
    <Grid   >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*"/>

        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
            <WrapPanel>
                <StackPanel>
                    <Button FontSize="18" Height="40" Width="40" Margin="5,0,0,0" Name="btnQuerySData" Click="btnQuerySData_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="Image/Find.png" />
                        </Button.Background>
                    </Button>
                </StackPanel>
                <StackPanel>
                    <TextBlock FontSize="18"   Width="Auto"  Margin="0,0,0,0" Text="原料" />
                    <ComboBox
                    Name="cbWTYE"
                    HorizontalAlignment="Left"
                    IsEditable="True"
                    Background="White"
                        Text="高级辅料"
                    IsTextSearchEnabled="True"
                    IsTextSearchCaseSensitive="False"                           
                    Width="Auto" 
                    >
                        <ComboBoxItem Content="成衣款式"/>
                        <ComboBoxItem Content="面料"/>
                        <ComboBoxItem Content="辅料"/>
                        <ComboBoxItem Content="高级辅料"/>
                    </ComboBox>
                </StackPanel>
                <StackPanel>
                    <WrapPanel>
                        <TextBox Background="Yellow"  FontSize="18"    Width="180" Name="txtMAT" CharacterCasing="Upper"  Text="" />
                    </WrapPanel>
                </StackPanel>
                <WrapPanel>
                    <Button Name="btnDeleteFS05" Click="btnDeleteFS05_Click" Margin="10,0,0,0" Height="40" Width="40">
                        <Button.Background>
                            <ImageBrush  ImageSource="Image/Delete.png" />
                        </Button.Background>
                    </Button>
                    <StackPanel>
                        <TextBlock Margin="10,0,0,0" >删除BOM</TextBlock>
                    <TextBlock Margin="10,0,0,0" >该物料当前款的所有记录都会被删除</TextBlock>
                </StackPanel>
                </WrapPanel>
            <WrapPanel>
     
                    <Button FontSize="18" Height="40" Width="40" Margin="10,0,0,0" Name="btnRefreshAB" Click="btnRefreshAB_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="Image/Reload.png" />
                        </Button.Background>
                    </Button>
                    <StackPanel>
                        <TextBlock Margin="10,0,0,0" >刷新生产单</TextBlock>
                        <TextBlock Margin="10,0,0,0" >该物料当前生产单款的原料需求会被删除</TextBlock>
                    </StackPanel>      
        </WrapPanel>
        </WrapPanel>
        </StackPanel>
        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="1">
            <TextBlock Name="txtMessage" Width="300"></TextBlock>
            <DataGrid  
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwFSSTUELI}}"  
                AutoGenerateColumns="False"
                EnableRowVirtualization="False"
                VerticalScrollBarVisibility="Auto"
                HorizontalScrollBarVisibility="Auto"
                VerticalAlignment="Stretch"
                HeadersVisibility="Column" 
                MaxHeight="600"
                FontSize="14"
                IsReadOnly="True"
                HorizontalAlignment="Stretch"
                RowDetailsVisibilityMode="Visible">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=FSABEZ, Converter={StaticResource ResourceKey=Trim}}" Header="描述" Width="Auto" MinWidth="120" />
                    <DataGridTextColumn Binding="{Binding Path=FSSART, Converter={StaticResource ResourceKey=Trim}}" Header="款式" Width="Auto" MinWidth="120" />
                    <DataGridTextColumn Binding="{Binding Path=FSSPOS}" Header="行" Width="Auto" MinWidth="20" />
                    <DataGridTextColumn Binding="{Binding Path=FSSFARBE, Converter={StaticResource ResourceKey=Trim}}" Header="色号" Width="Auto" MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=FSSGROE, Converter={StaticResource ResourceKey=Trim}}" Header="尺码" Width="Auto" MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=FSSMART, Converter={StaticResource ResourceKey=Trim}}" Header="物料" Width="Auto" MinWidth="120" />
                    <DataGridTextColumn Binding="{Binding Path=FSSMFARBE, Converter={StaticResource ResourceKey=Trim}}" Header="色号" Width="Auto" MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=FSSMGROE, Converter={StaticResource ResourceKey=Trim}}" Header="尺寸" Width="Auto" MinWidth="60" />
                </DataGrid.Columns>
            </DataGrid>
        </StackPanel>
        <StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="1">
            <DataGrid  
                CanUserReorderColumns="True"  
                CanUserResizeRows="True" 
                CanUserSortColumns="True"                  
                AutoGenerateColumns="False"   
                EnableRowVirtualization="False"   
                IsSynchronizedWithCurrentItem="True"
                MaxHeight="400"
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwFDECK}}"  
                Margin="0,1,0,0" 
                >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=ABPAUFKRS}" Header=" "   Width="40" />
                    <DataGridTextColumn Binding="{Binding Path=ABPAUFLFD}" Header="生产单"   Width="80" />
                    <DataGridTextColumn Binding="{Binding Path=ABPAUFPOS}" Header=""   Width="40" />
                    <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="颜色"   Width="120" />
                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="颜色"   Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=ABPGROE}" Header="尺码"   Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=ABPSOLLMENGE7,Converter={StaticResource ResourceKey=d100}}" Header="件数"   Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=FDMENGE}" Header="数量"   Width="60" />
                </DataGrid.Columns>
            </DataGrid  >
            <DataGrid  
                CanUserReorderColumns="True"  
                CanUserResizeRows="True" 
                CanUserSortColumns="True"                  
                AutoGenerateColumns="False"   
                EnableRowVirtualization="False"   
                MaxHeight="400"
                IsSynchronizedWithCurrentItem="True"
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwWDECK}}"  
                Margin="0,1,0,0" 
                IsTextSearchCaseSensitive="True"  
                >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=ABPAUFKRS}" Header=" "   Width="40" />
                    <DataGridTextColumn Binding="{Binding Path=ABPAUFLFD}" Header="生产单"   Width="80" />
                    <DataGridTextColumn Binding="{Binding Path=ABPAUFPOS}" Header=""   Width="40" />
                    <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="颜色"   Width="120" />
                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="颜色"   Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=ABPGROE}" Header="尺码"   Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=ABPSOLLMENGE7,Converter={StaticResource ResourceKey=d100}}" Header="数量"   Width="60" />
                </DataGrid.Columns>
            </DataGrid  >
        </StackPanel>
    </Grid>
</local:DocumentBase>
